package com.jeesite.modules.video.service;

import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.video.entity.DcSupVideo;
import com.jeesite.modules.video.dao.DcSupVideoDao;
import com.jeesite.modules.file.utils.FileUploadUtils;

/**
 * 微课视频Service
 * @author xhc
 * @version 2022-10-12
 */
@Service
@Transactional(readOnly=false)
public class DcSupVideoService extends CrudService<DcSupVideoDao, DcSupVideo> {
	
	/**
	 * 获取单条数据
	 * @param dcSupVideo
	 * @return
	 */
	@Override
	public DcSupVideo get(DcSupVideo dcSupVideo) {
		return super.get(dcSupVideo);
	}
	
	/**
	 * 查询分页数据
	 * @param dcSupVideo 查询条件
	 * @param dcSupVideo.page 分页对象
	 * @return
	 */
	@Override
	public Page<DcSupVideo> findPage(DcSupVideo dcSupVideo) {
		return super.findPage(dcSupVideo);
	}
	
	/**
	 * 查询列表数据
	 * @param dcSupVideo
	 * @return
	 */
	@Override
	public List<DcSupVideo> findList(DcSupVideo dcSupVideo) {
		return super.findList(dcSupVideo);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param dcSupVideo
	 */
	@Override
	@Transactional(readOnly=false)
	public void save(DcSupVideo dcSupVideo) {
		super.save(dcSupVideo);
		// 保存上传附件
		FileUploadUtils.saveFileUpload(dcSupVideo, dcSupVideo.getId(), "dcSupVideo_file");
	}
	
	/**
	 * 更新状态
	 * @param dcSupVideo
	 */
	@Override
	@Transactional(readOnly=false)
	public void updateStatus(DcSupVideo dcSupVideo) {
		super.updateStatus(dcSupVideo);
	}
	
	/**
	 * 删除数据
	 * @param dcSupVideo
	 */
	@Override
	@Transactional(readOnly=false)
	public void delete(DcSupVideo dcSupVideo) {
		super.delete(dcSupVideo);
	}
	
}